load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "authserver",
    srcs = [
        "api.go",
        "api_v2.go",
        "api_v2_auth.go",
        "authentication.go",
        "context.go",
        "cookie.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/server/authserver",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/multitenant",
        "//pkg/roachpb",
        "//pkg/security",
        "//pkg/security/password",
        "//pkg/security/username",
        "//pkg/server/apiutil",
        "//pkg/server/serverpb",
        "//pkg/server/srverrors",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/isql",
        "//pkg/sql/privilege",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondata",
        "//pkg/sql/syntheticprivilege",
        "//pkg/sql/types",
        "//pkg/ui",
        "//pkg/util/grpcutil",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library",
        "@org_golang_google_grpc//:go_default_library",
        "@org_golang_google_grpc//codes",
        "@org_golang_google_grpc//metadata",
        "@org_golang_google_grpc//status",
    ],
)

go_test(
    name = "authserver_test",
    srcs = [
        "authentication_test.go",
        "main_test.go",
    ],
    deps = [
        ":authserver",
        "//pkg/base",
        "//pkg/gossip",
        "//pkg/kv/kvclient/kvtenant",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/closedts/ctpb",
        "//pkg/kv/kvserver/kvserverpb",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/security",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/server/apiconstants",
        "//pkg/server/debug",
        "//pkg/server/serverpb",
        "//pkg/settings/cluster",
        "//pkg/sql/execinfrapb",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/testcluster",
        "//pkg/ts",
        "//pkg/ts/tspb",
        "//pkg/util",
        "//pkg/util/httputil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_gogo_protobuf//jsonpb",
        "@com_github_lib_pq//:pq",
        "@com_github_stretchr_testify//require",
        "@org_golang_google_grpc//:go_default_library",
        "@org_golang_google_grpc//credentials",
        "@org_golang_x_crypto//bcrypt",
    ],
)
